<%@page import="com.lmpop.trade.backupDB.Backup"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<%
	Backup backup = new Backup();
	String table_name = "";
	if(request.getParameter("table_name")!=null){
		table_name = request.getParameter("table_name");
	}
	List sList = backup.selTableStructure(table_name);
	//out.println(sList+"=====");
%>
<html>
<title><%=table_name%>的表结构</title>
<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
<body>
    <div class="form">
	    <table border="0" style="background:#cecece;">
				<tr bgcolor="#D1E9FC">
					<td colspan="5">
						表名：<b><%=table_name%></b>&nbsp;&nbsp;
						<a href="/program/admin/backupDb/index.jsp">返回</a>
					</td>
				</tr>
				<tr bgcolor="#FDFBD5">
				<td>
					<b>字段名称</b>
				</td>
				<td>
					<b>是否主键</b>
				</td>
				<td>
					<b>字段类型</b>
				</td>
				<td>
					<b>默认值</b>
				</td>
				<td>
					<b>是否允许为空</b>
				</td>
			</tr>
			<%
				if(sList!=null && sList.size()>0){
					for(int i=0;i<sList.size();i++){
						Hashtable map = (Hashtable)sList.get(i);
						String fieldName = "",fieldType="",allowNULL="",isKey="",dvalue="";
						if(map.get("Field")!=null){
							fieldName = map.get("Field").toString();
						}
						if(map.get("Type")!=null){
							fieldType = map.get("Type").toString();
						}
						if(map.get("Null")!=null){
							allowNULL = map.get("Null").toString();
						}
						if(map.get("Key")!=null){
							isKey = map.get("Key").toString();
						}
						if(map.get("Default")!=null){
							dvalue = map.get("Default").toString();
						}
			%>
			<tr bgcolor="#FDFBD5">
				<td>
					<%=fieldName%>
				</td>
				<td>
					<%=isKey%>
				</td>
				<td>
					<%=fieldType%>
				</td>
				<td>
					<%=dvalue%>
				</td>
				<td>
					<%=allowNULL%>
				</td>
			</tr>
					<%
					}
				}
			%>
		</table>
</div>
</body>
</html>